//Name: Cao Dung Anh
//Class: 11CTT
//Sid: 1151003

#pragma once

class UserInfo
{
private:
	char Username[100];
	char Password[100];
	char Name[100];
	struct DayofBirth
	{
		int day;
		int month;
		int year;
	} DoB;
	int id;
	char Address[100];
	bool Sex;
	int UserType;
	int Status;// 0:inactivated;1:activated;2:banned;3:deleted;
public:
	UserInfo();
	void addUser();
	void addUser(int usertype,char *username,char *name);
	void showInfo();
	void copyInfo(UserInfo a);
	bool isExist(char *username);
	bool isRightPass(char *password);
	bool isExist(char *username,char *pass);
	int getUserType();
	int getStatus();
	char* getUserName();
	char* getName();
	void changePassWord();
	void banAcc();
	void setUserStatus(int num);

	char* normalizeName(char* str);
	char* createUsernamefromName(char *name);
	char* deleteSpaceAtFirstString(char *str);

	//Phuong Anh
	bool checkDay(int day);
	bool checkMonth(int month);
	bool checkYear(int year);
	bool checkPassword(char pass[]);
	bool checkName(char name[]);
	bool checkUserName(char name[]);

	bool checkDatetime(int day, int month, int year);
	char* EncryptPassword(char* pass);
	void setPassword(char *pass);

	int getDay();
	int getmonth();
	int getyear();
	int getID();
	char* getAddress();
	bool getSex();
};
